//
//  CQBottomView.swift
//  swift-weibo
//
//  Created by 陈乾 on 15/11/1.
//  Copyright © 2015年 陈乾. All rights reserved.
//

import UIKit

class CQBottomView: UIView {


    //MARK: - 初始化方法
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override init(frame: CGRect
        ) {
            super.init(frame: frame)
            backgroundColor = UIColor(white: 0.96, alpha: 0.9)
            prepareUI()
    }
   
    //MARK: - 准备UI
    func prepareUI() {
      //添加子控件
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(spearatorLine1)
        addSubview(spearatorLine2)

        //添加约束
        //三个按钮平铺 view
        //拿父控制器来调
        self.ff_HorizontalTile([forwardButton,commentButton,likeButton], insets: UIEdgeInsetsZero)
        //线的约束
        spearatorLine1.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        
        spearatorLine2.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
        
        
        
        
    }
    //MARK: - 懒加载
    private lazy var forwardButton: UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet", titleColor: UIColor.lightGrayColor(), fontSize: 13)
    
    private lazy var commentButton: UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment", titleColor: UIColor.lightGrayColor(), fontSize: 13)
 
    private lazy var likeButton: UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike", titleColor: UIColor.lightGrayColor(), fontSize: 13)
    
    //分割线
    private lazy var spearatorLine1: UIImageView = UIImageView()
    private lazy var spearatorLine2: UIImageView = UIImageView()



}
